import { Interpreter } from 'xstate';

const excludeKeys = ['jzj/cycledata', 'jzj/envdata', 'fill/fill_status', 'order/fill_status', 'jzj/index','driver/team', 'newFile/Create', 'integral/Verification'];
const TIMEOUT = 5 * 1000;

const pool = {} as {
  [T : string] : {
    machineService : Interpreter<any, any, any, any, any>;
    onMsg : (obj : any) => void;
  };
};

function getKey(topic : string) {
  return topic.replace('formal/v1/', '').replace(/\/(client|server).*/, '');
}

export { TIMEOUT, pool, getKey, excludeKeys };